package ch.areion.areionapp.engine;

public enum MotorSide {
	/**
	 * Left motor in driving direction.
	 */
	LEFT(1),
	/**
	 * The right motor in driving direction.
	 */
	RIGHT(2);

	/**
	 * Constructor for setting the correct value.
	 * @param value The value of the enum item.
	 */
	private MotorSide(int value) {
		this.value = value;
	}

	/**
	 * The value to store enum value.
	 */
	private int value;
	/**
	 * Returns the value of the enumeration item.
	 * @return
	 */
	public int getValue(){
		return this.value;
	}

	/**
	 * Gets the enum value of a given value.
	 * @param value The given Value
	 * @return LEFT or RIGHT depending on value. LEFT if unknown!
	 */
	public MotorSide of(int value) {
		switch(value) {
		case 1:
		default:
			return LEFT;
		case 2:
			return RIGHT;
		}
	}
}
